package com.ayu.scalalearn.chapter06


import com.ayu.scalalearn.chapter06.Test02ClassForAccess.Person


/**
  * @Author 徐林玉
  * @Description Test02Access
  * @Date 2022/7/28 13:48
  * @Version 1.0
  */
object Test02Access {


  def main(args: Array[String]): Unit = {

    var p1 = new Person()

    p1.printInfo()
    //  p1.sex


    val worker: Worker = new Worker()

    worker.printInfo()
  }

}


class Worker extends Person {

  //name = "里斯" /error

  age = 10

  idCard = "5555"

  sex = "male"

  override def printInfo(): Unit = {


    println("我是:" + sex + " 我" + age + "岁")
  }
}



